use "${tmp}/Cifre_0318_NAF_ZE_collapse", clear

	merge 1:1 ape ZE2010 year using "${tmp}/SoustraitPubCIR_ZE_NAF_groupfiscal", nogen
	merge 1:1 ape ZE2010 year using "${tmp}\siren_priv_hire_researchers_from_siren_pub.dta", nogen
	merge 1:1 ape ZE2010 year using  "${tmp}/firm_crea_dads", nogen
	merge 1:1 ape ZE2010 year using "${tmp}/JEU_ZE_NAF", nogen
	
	
	gen has_jdoc = amt_jdoc_max_gf != 0 & amt_jdoc_max_gf != .
	gen has_cifre = nb_newcifre > 0 & nb_newcifre != .
	gen has_soustrai = soustrait_pub_max_gf > 0 & soustrait_pub_max_gf != .
	gen ln_soustrait = log(soustrait_pub_max_gf)
	replace newempnolarge =  newempnolarge_newsiren + newempnolarge_oldsiren
	gen mobsen = nbheur_seniorrespubtopri != . & nbheur_seniorrespubtopri > 35
	gen mobres = nbheur_respubtopri != . & nbheur_respubtopri > 35
	gen mobjun = nbheur_respubtopri-nbheur_seniorrespubtopri > 35 & mobres == 1
	gen has_jeu = nb_newjeu > 0 & nb_newjeu != .

	merge 1:1 ape ZE2010 year  using "${tmp}/regfile", keep(2 3) nogen
	
	
save "${tmp}/regfile", replace